package com.lytoyo.neihanduanzi.model.index;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;

/**
 * Package:com.lytoyo.neihanduanzi.model.index
 *
 * @ClassName:UserIndex
 * @Create:2025/4/2 16:02
 **/
@Document(indexName = "user")
//防止json字符串转成实体对象时因未识别字段报错
@JsonIgnoreProperties(ignoreUnknown = true)
@Accessors(chain = true)
@Data
public class UserIndex implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    private Long id;

    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String nickname;

    @Field(type = FieldType.Keyword)
    private String headPhoto;

    @Field(type = FieldType.Long)
    private Long fans;

    @Field(type = FieldType.Integer)
    private Integer gender;

    @Field(type = FieldType.Keyword)
    private String email;

    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String signature;

}
